<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/view/jsp/admin/includes/taglibs.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>应用列表</title>
		<%@ include file="/WEB-INF/view/jsp/admin/includes/meta.jsp"%>
		<link type="text/css" rel="stylesheet" href="${ctx}/admin/css/admin.css" />
		<link href="${ctx}/widgets/extremecomponents/extremecomponents.css"
			type="text/css" rel="stylesheet" />
		<script type="text/javascript">
		function go(url)
		{
			window.location.href = url;
		}
		function deleData(url)
		{
			if(confirm("确定要删除吗？"))
			{
				window.location.href = url;
			}
		}
	</script>
	</head>

	<body>
		<div class="mask">
			<div class="container">
				<h3>
					应用列表
				</h3>
				<div id="content">
					<ec:table items="page.result" var="application" rowsDisplayed="10"
						autoIncludeParameters="true" retrieveRowsCallback="limit"
						action="${ctx}/admin/application.do">
						<ec:row highlightRow="true">
							<ec:column property="rowcount" cell="rowCount" sortable="false"
								title="序号" width="30" />
							<ec:column property="name" title="应用名称" width="120">
							</ec:column>
							<ec:column property="type" title="应用类型" width="80">
							</ec:column>
							<ec:column property="url" title="URL" sortable="false" />
							<ec:column property="ip" title="应用IP" width="100" />
							<ec:column property="createdDate" title="创建日期" width="60"
								sortable="true" cell="date" format="yyyy-MM-dd" />
							<ec:column property="null" title="动作" sortable="false" width="50"
								viewsAllowed="html">
								<security:authorize ifAnyGranted="ROLE_ADMIN">
									<a href="#" class="ref"
										onclick="javascript:go('${ctx}/admin/application!edit.do?id=${application.id}');">修改</a>
									<a href="#" class="ref"
										onclick="javascript:deleData('${ctx}/admin/application!delete.do?id=${application.id}');">删除</a>
								</security:authorize>
							</ec:column>
						</ec:row>
					</ec:table>

					<div id="footer" class="footer">
						<security:authorize ifAnyGranted="ROLE_ADMIN">
							<input type="button" class="btn"
								onclick="javascript:go('${ctx}/admin/application!edit.do?id=');"
								value='增加新应用' />
						</security:authorize>
					</div>
				</div>
			</div>
		</div>
	</body>
</html>
